for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
'use strict'
const output = require('../output')
const path = require('path')
const childProcess = require('shelljs')
function runProcess (script, callback, basePath) {
var opts = {
silent: true,
async: true
}
if (basePath) {
opts.cwd = path.resolve(basePath)
var process = childProcess.exec(script, opts)
output.logComponent('Script', 'blue', 'Executing "' + script + '"')
process.on('exit', function (code) {
code = parseInt(code, 10) || code
output.logComponent('Script', code === 0 ? 'blue' : 'red', 'Exited with code ' + code)
if (callback) {
callback(code)
})
process.stderr.on('data', function (message) {
output.logComponent('Script', 'red', message)
process.stdout.on('data', function (message) {
output.logComponent('Script', 'blue', message)
module.exports = {
run: runProcess